package com.yykj.user.center.client.feign;

import com.yykj.common.dto.CreateAccountDTO;
import com.yykj.user.center.client.dto.ConsultationOrderInfoDTO;
import com.yykj.user.center.client.dto.ConsultationStatisticsDto;
import com.yykj.user.center.client.dto.DoctorConsultationCountDto;
import com.yykj.user.center.client.dto.PatientInfoDto;
import com.yykj.user.center.client.fallback.UserFallbackFactory;
import com.yykj.user.center.client.form.AddGroupForm;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = "user-center", fallbackFactory = UserFallbackFactory.class)
public interface UserFeignClient {

    @GetMapping("/proto/api/tencent/createAccount")
    @ApiOperation(value = "创建账户",notes = "创建账户")
    public CreateAccountDTO createAccount(@RequestParam(value = "identifier",required = true) String identifier,
                                                    @RequestParam(value = "nick",required = true) String nick,
                                                    @RequestParam(value = "faceUrl",required = true) String faceUrl);

    @GetMapping("/proto/api/tencent/userSign")
    @ApiOperation(value = "获取用户UserSign",notes = "UserSig 是用户登录即时通信 IM 的密码")
    public String userSign(@RequestParam(value = "accid",required = true) String accid);

    @PostMapping("/api/group/createDefault")
    @ApiOperation("创建默认分组 ")
    public void createDefault(@RequestBody AddGroupForm addGroupForm);

    @GetMapping("/api/proto/order/statistics")
    @ApiOperation(value = "问诊统计")
    public ConsultationStatisticsDto statistics(@RequestParam(value = "doctorId", required = true) String doctorId);

    @PostMapping("/api/proto/doctor/doctorConsultationCount")
    @ApiOperation(value = "医生问诊数量", notes = "医生问诊数量")
    public List<DoctorConsultationCountDto> doctorConsultationCount(
            @RequestBody List<String> doctorIds
    );

    @GetMapping("/api/proto/order/orderInfo")
    @ApiOperation(value = "根据订单号获取问诊详情")
    public ConsultationOrderInfoDTO orderInfo(@RequestParam(value = "orderNo", required = true) String orderNo);

    @GetMapping("/proto/api/patient/info")
    @ApiOperation(value = "获取患者信息")
    PatientInfoDto patientInfo(@RequestParam(value = "patientId",required = true) String patientId);

}
